package com.zxbit.flash.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class IdentityData implements Serializable {

    private static final long serialVersionUID = -7997073450709442310L;
    /**
     * identity : {"address":"KP.SAWAH JL.KENANGA III NO.43","birthPlace":"","birthday":"","bloodType":"","city":"KOTA BEKASI","district":"PONDOK MELATI","expiryDate":"26-09-2017","gender":"PEREMPUAN","identityCardNum":"3275126609880006","maritalStatus":"KAWIN","nationality":"WNI","occupation":"MENGURUS RUMAH TANGGA","province":"JAWA BARAT","realName":"SITI MASYITOH","religion":"KRISTEN","rt":"005","rw":"002","village":"JATIMELATI"}
     */

    private IdentityBean identity;
    /**
     * imageInfo : {"fileType":1,"imageName":"file","imagePath":"/Users/wxc/Desktop//APP/2018-12/20/9fpKkFAU.jpg/kSvcdLHz .jpg","imageUrl":"http://47.92.118.116/Users/wxc/Desktop//APP/2018-12/20/9f pKkFAU.jpg/kSvcdLHz.jpg"}
     */

    private ImageInfoBean imageInfo;

    public IdentityBean getIdentity() {
        return identity;
    }

    public void setIdentity(IdentityBean identity) {
        this.identity = identity;
    }

    public ImageInfoBean getImageInfo() {
        return imageInfo;
    }

    public void setImageInfo(ImageInfoBean imageInfo) {
        this.imageInfo = imageInfo;
    }

    public static class IdentityBean {
        /**
         * address : KP.SAWAH JL.KENANGA III NO.43
         * birthPlace :
         * birthday :
         * bloodType :
         * city : KOTA BEKASI
         * district : PONDOK MELATI
         * expiryDate : 26-09-2017
         * gender : PEREMPUAN
         * identityCardNum : 3275126609880006
         * maritalStatus : KAWIN
         * nationality : WNI
         * occupation : MENGURUS RUMAH TANGGA
         * province : JAWA BARAT
         * realName : SITI MASYITOH
         * religion : KRISTEN
         * rt : 005
         * rw : 002
         * village : JATIMELATI
         */

        private String address;
        private String birthPlace;
        private String birthday;
        private String bloodType;
        private String city;
        private String district;
        private String expiryDate;
        private String gender;
        private String identityCardNum;
        private String maritalStatus;
        private String nationality;
        private String occupation;
        private String province;
        private String realName;
        private String religion;
        private String rt;
        private String rw;
        private String village;

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getBirthPlace() {
            return birthPlace;
        }

        public void setBirthPlace(String birthPlace) {
            this.birthPlace = birthPlace;
        }

        public String getBirthday() {
            return birthday;
        }

        public void setBirthday(String birthday) {
            this.birthday = birthday;
        }

        public String getBloodType() {
            return bloodType;
        }

        public void setBloodType(String bloodType) {
            this.bloodType = bloodType;
        }

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public String getDistrict() {
            return district;
        }

        public void setDistrict(String district) {
            this.district = district;
        }

        public String getExpiryDate() {
            return expiryDate;
        }

        public void setExpiryDate(String expiryDate) {
            this.expiryDate = expiryDate;
        }

        public String getGender() {
            return gender;
        }

        public void setGender(String gender) {
            this.gender = gender;
        }

        public String getIdentityCardNum() {
            return identityCardNum;
        }

        public void setIdentityCardNum(String identityCardNum) {
            this.identityCardNum = identityCardNum;
        }

        public String getMaritalStatus() {
            return maritalStatus;
        }

        public void setMaritalStatus(String maritalStatus) {
            this.maritalStatus = maritalStatus;
        }

        public String getNationality() {
            return nationality;
        }

        public void setNationality(String nationality) {
            this.nationality = nationality;
        }

        public String getOccupation() {
            return occupation;
        }

        public void setOccupation(String occupation) {
            this.occupation = occupation;
        }

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public String getRealName() {
            return realName;
        }

        public void setRealName(String realName) {
            this.realName = realName;
        }

        public String getReligion() {
            return religion;
        }

        public void setReligion(String religion) {
            this.religion = religion;
        }

        public String getRt() {
            return rt;
        }

        public void setRt(String rt) {
            this.rt = rt;
        }

        public String getRw() {
            return rw;
        }

        public void setRw(String rw) {
            this.rw = rw;
        }

        public String getVillage() {
            return village;
        }

        public void setVillage(String village) {
            this.village = village;
        }

        public IdentityBean() {
        }

        public IdentityBean(AuthInfoData.IdentityBean identityBean) {
            realName = identityBean.getRealName();
            identityCardNum = identityBean.getIdentityCardNum();
            bloodType = identityBean.getBloodType();
            religion = identityBean.getReligion();
            gender = identityBean.getGender();
            birthday = identityBean.getBirthday();
            birthPlace = identityBean.getBirthPlace();
            province = identityBean.getProvince();
            city = identityBean.getCity();
            district = identityBean.getDistrict();
            village = identityBean.getVillage();
            address = identityBean.getAddress();
            rt = identityBean.getRt();
            rw = identityBean.getRw();
            nationality = identityBean.getNationality();
            maritalStatus = identityBean.getMaritalStatus();
            occupation = identityBean.getOccupation();
            expiryDate = identityBean.getExpiryDate();
        }

        public IdentityBean(String[] value) {
            realName = value[0];
            identityCardNum = value[1];
            bloodType = value[2];
            religion = value[3];
            gender = value[4];
            birthday = value[5];
            birthPlace = value[6];
            province = value[7];
            city = value[8];
            district = value[9];
            village = value[10];
            address = value[11];
            rt = value[12];
            rw = value[13];
            nationality = value[14];
            maritalStatus = value[15];
            occupation = value[16];
            expiryDate = value[17];
        }

        @Override
        public String toString() {
            return "IdentityBean{" +
                    "address='" + address + '\'' +
                    ", birthPlace='" + birthPlace + '\'' +
                    ", birthday='" + birthday + '\'' +
                    ", bloodType='" + bloodType + '\'' +
                    ", city='" + city + '\'' +
                    ", district='" + district + '\'' +
                    ", expiryDate='" + expiryDate + '\'' +
                    ", gender='" + gender + '\'' +
                    ", identityCardNum='" + identityCardNum + '\'' +
                    ", maritalStatus='" + maritalStatus + '\'' +
                    ", nationality='" + nationality + '\'' +
                    ", occupation='" + occupation + '\'' +
                    ", province='" + province + '\'' +
                    ", realName='" + realName + '\'' +
                    ", religion='" + religion + '\'' +
                    ", rt='" + rt + '\'' +
                    ", rw='" + rw + '\'' +
                    ", village='" + village + '\'' +
                    '}';
        }

        public String[] toArray() {
            return new String[]{ realName, identityCardNum, bloodType, religion, gender,
                    birthday, birthPlace, province, city, district, village, address, rt, rw,
                    nationality, maritalStatus, occupation, expiryDate };
        }

        public Map<String, Object> toMap (){
            Map<String, Object> map = new HashMap<>();
            map.put("realName", realName);
            map.put("identityCardNum", identityCardNum);
            map.put("bloodType", bloodType);
            map.put("religion", religion);
            map.put("gender", gender);
            map.put("birthday", birthday);
            map.put("birthPlace", birthPlace);
            map.put("province", province);
            map.put("city", city);
            map.put("district", district);
            map.put("village", village);
            map.put("address", address);
            map.put("rt", rt);
            map.put("rw", rw);
            map.put("nationality", nationality);
            map.put("maritalStatus", maritalStatus);
            map.put("occupation", occupation);
            map.put("expiryDate", expiryDate);
            return map;
        }
    }

    public static class ImageInfoBean implements Serializable{

        private static final long serialVersionUID = 156946244872873669L;
        /**
         * fileType : 1
         * imageName : file
         * imagePath : /Users/wxc/Desktop//APP/2018-12/20/9fpKkFAU.jpg/kSvcdLHz .jpg
         * imageUrl : http://47.92.118.116/Users/wxc/Desktop//APP/2018-12/20/9f pKkFAU.jpg/kSvcdLHz.jpg
         */

        private int fileType;
        private String imageName;
        private String imagePath;
        private String imageUrl;

        public int getFileType() {
            return fileType;
        }

        public void setFileType(int fileType) {
            this.fileType = fileType;
        }

        public String getImageName() {
            return imageName;
        }

        public void setImageName(String imageName) {
            this.imageName = imageName;
        }

        public String getImagePath() {
            return imagePath;
        }

        public void setImagePath(String imagePath) {
            this.imagePath = imagePath;
        }

        public String getImageUrl() {
            return imageUrl;
        }

        public void setImageUrl(String imageUrl) {
            this.imageUrl = imageUrl;
        }
    }
}
